import React, { useState } from 'react';

function TelShow({ tel }) {
  const [flag, setFlag] = useState(true);
  return (
    <>
      {flag ? (
        <span
          onClick={() => {
            setFlag(false);
          }}
          style={{ cursor: 'pointer', color: 'yellowgreen' }}>
          {' '}
          181****7814{' '}
        </span>
      ) : (
        <span
          onClick={() => {
            setFlag(true);
          }}
          style={{ cursor: 'pointer', color: 'skyblue' }}>
          {tel}
        </span>
      )}
    </>
  );
}

export default TelShow;
